﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Reflection;
using ADONETDataServicesExtension.Utils;

namespace ADONETDataServicesExtension.Providers
{
    public class ServiceOperation : FrameworkEncapsulatedType<object>
    {
        internal const string FrameworkTypeName = "System.Data.Services.Providers.ServiceOperation";

        public ServiceOperation(object serviceOperation)
            : base(serviceOperation)
        {
        }

        public MethodInfo Method
        {
            get
            {
                return ReflectionHelper.GetProperty<MethodInfo>(FrameworkTypeName, "Method", FrameworkObject);
            }
        }

        public int ResultKind
        {
            get
            {
                return ReflectionHelper.GetProperty<int>(FrameworkTypeName, "ResultKind", FrameworkObject);
            }
            set
            {
                ReflectionHelper.SetProperty(FrameworkTypeName, "ResultKind", FrameworkObject, value);
            }
        }

        public string MimeType
        {
            get
            {
                return ReflectionHelper.GetProperty<string>(FrameworkTypeName, "MimeType", FrameworkObject);
            }
        }
    }
}
